//
//  CarSetListCell.m
//  New_Runway
//
//  Created by mack on 2018/1/27.
//  Copyright © 2018年 NelsonJ. All rights reserved.
//

#import "CarSetListCell.h"

@implementation CarSetListCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self addAllViews];
        self.contentView.backgroundColor = [UIColor whiteColor];
    }
    return self;
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)addAllViews
{
    kSelfWeak;

    self.StarL = [[UILabel alloc] init];
    self.StarL.text = @"*";
    self.StarL.textColor = kColorRed();
    self.StarL.font = [UIFont systemFontOfSize:13];
    self.StarL.hidden = YES;
    [self.contentView addSubview:self.StarL];
    
    [weakSelf.StarL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.contentView).mas_offset(7);
        make.centerY.equalTo(weakSelf.contentView);
        
    }];
    
    self.label = [[UILabel alloc] init];
    self.label.textColor = MAIN_FONT_COLOR();
    self.label.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:self.label];
    [self.label mas_makeConstraints:^(MASConstraintMaker *make) {
    
        make.left.equalTo(weakSelf.contentView).mas_offset(15);
        make.centerY.equalTo(weakSelf.contentView);
        
    }];
    
    self.rightImage = [[UIButton alloc] init];
    self.rightImage.userInteractionEnabled = NO;
    [self.contentView addSubview:self.rightImage];
    [_rightImage setImage:[UIImage imageNamed:@"up"] forState:UIControlStateNormal];
    [_rightImage.titleLabel setFont:[UIFont systemFontOfSize:13]];
    [_rightImage setTitleColor:MAIN_FONT_COLOR() forState:UIControlStateNormal];
    [self.rightImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(weakSelf.contentView);
        make.right.equalTo(weakSelf.contentView).mas_offset(-15);
    }];
    
    self.centerLabel  = [[UILabel alloc] init];
    self.centerLabel.numberOfLines = 0;
    self.centerLabel.textColor = MAIN_FONT_COLOR();
    self.centerLabel.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:_centerLabel];
    [self.centerLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.contentView).mas_offset(110);
        make.right.equalTo(weakSelf.rightImage).mas_offset(-30);
        make.top.bottom.equalTo(weakSelf.contentView);
    }];
    
    
    
    self.centerTF = [[UITextField alloc] init];
    self.centerTF.tintColor = MAIN_NAV_COLOR();
    self.centerTF.textColor = MAIN_FONT_COLOR();
    [self.centerTF setFont:[UIFont systemFontOfSize:13]];
    [self.contentView addSubview:self.centerTF];
    [self.centerTF mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.contentView).mas_offset(110);
        make.right.equalTo(weakSelf.rightImage).mas_offset(-30);
        make.top.bottom.equalTo(weakSelf.contentView);
    }];
    
    self.picImage = [[UIImageView alloc] init];
    self.picImage.image = [UIImage imageNamed:@"pic"];
    self.picImage.hidden = YES;
    [self.contentView addSubview:self.picImage];
    [weakSelf.picImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.contentView).mas_offset(110);
        make.centerY.equalTo(weakSelf.contentView);
        
    }];
    
    UIView *view = [[UIView alloc] init];
    view.backgroundColor = UIColorHex(0xcccccc);
    [self.contentView addSubview:view];
    [view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(weakSelf.contentView);
        make.bottom.equalTo(weakSelf.contentView);
        make.height.mas_offset(0.5);
    }];
  
    
    _switchButton = [[UISwitch alloc] init];
    [_switchButton setOn:NO];
    _switchButton.tintColor = UIColorHex(0xf5f5f5);
    _switchButton.onTintColor = MAIN_NAV_COLOR();
    _switchButton.userInteractionEnabled = NO;
    [self.contentView addSubview:_switchButton];
    [_switchButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(weakSelf.contentView);
        make.right.equalTo(weakSelf.contentView).mas_offset(-15);
    }];
    
    
    
    
    
}

@end
